//
//  Word.m
//  CslpodDictionary
//
//  Created by gtts on 13-4-24.
//  Copyright (c) 2013年 cslpod. All rights reserved.
//

#import "Word.h"

@implementation WordDAO

const static NSString* tablename = @"dic_word";//表名

+ (Class)getBindingModelClass
{
    return [Word class];
}

+(const NSString *)getTableName
{
    return tablename;
}

@end

@implementation Word
@synthesize wordID;
@synthesize word;
@synthesize pinyin;
@synthesize simplePinyin;
@synthesize tranditional;
@synthesize english;
@synthesize japanese;
@synthesize samples;
@synthesize pos;
@synthesize section;
@synthesize relations;

- (id)init
{
    self = [super init];
    if (self) {
        self.primaryKey = @"wordID";
    }
    return self;
}

- (id)initWithJsonDictionary:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.wordID = [dic objectForKey:@"wordID"];
        self.word = [dic objectForKey:@"word"];
        self.pinyin = [dic objectForKey:@"pinyin"];
        self.simplePinyin = [dic objectForKey:@"simplePinyin"];
        self.tranditional = [dic objectForKey:@"tranditional"];
        self.english  = [dic objectForKey:@"english"];
        self.japanese = [dic objectForKey:@"japanese"];
        self.samples = [dic objectForKey:@"samples"];
        self.pos = [dic objectForKey:@"pos"];
        self.section = [dic objectForKey:@"section"];
        self.relations = [dic objectForKey:@"relations"];
    }
    return self;
}

@end
